<?php
      //验证学号不为空
      if(empty($_POST['sid'])){
          skip('register.php','glyphicon-remove-sign','学号不得为空');
      }

       //验证学号长度
         if(mb_strlen($_POST['sid'])>13 || mb_strlen($_POST['sid'])<11){
           skip('register.php','glyphicon-remove-sign','学号长度不正确');
         }



      //验证姓名不为空
       if(empty($_POST['username'])){
          skip('register.php','glyphicon-remove-sign','姓名不得为空');
      }

      //验证性别不为空
       if(empty($_POST['sex'])){
            skip('register.php','glyphicon-remove-sign','姓别不得为空');
       }
      //验证密码不为空
        if(empty($_POST['pwd'])){
             skip('register.php','glyphicon-remove-sign','密码不得为空');
        }

     //学号不得重复
     $query = "select * from user where sid='{$_POST['sid']}' ";
     $result = execute($link,$query);
      if(mysqli_num_rows($result)){
           skip('register.php','glyphicon-remove-sign','这个学号已被注册');
      }










?>